<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>商品列表</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
      href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
      href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">
<!-- Custom styles for this template -->
<link href="${pageContext.request.contextPath}/static/css/carousel.css"
      rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>
<script src="${pageContext.request.contextPath}/static/js/cart.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript">
    function payForOrder() {
//        alert(1);
        var orderId = $("#pay").val();
//        alert(orderId);
        window.open("${pageContext.request.contextPath}/order/pay?oid=" + orderId);
        clearCart();
        $("#confirmTitle").html("请确认");
        $("#confirmBody").html("请选择您属于下列哪种情况：");
        $("#confirmOk").html("付款成功");
        $("#confirmNo").html("付款遇到问题，未完成支付");
        $("#confirmModal").modal();

        $("#confirmOk").click(function () {
            location.href = "${pageContext.request.contextPath}/order/payForOrder?oid=" + orderId;
        });
    }
</script>

<c:import url="../common/userTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        请选择付款方式：
        <form method="post">
            <div class="col-md-10 col-md-offset-1">
                <input type="hidden" id="pay" value="${oid==null?param.oid:oid}"/>
                <button class="btn btn-primary" type="button" onclick="payForOrder()">去网银付款</button>
                <button class="btn btn-primary" type="button" onclick="javascript:location.href='${pageContext.request.contextPath}/order/getMyOrders'">返回订单列表页面
                </button>
            </div>
        </form>
    </div>
</div>

<c:import url="../common/userFooter.jsp"/>
</body>
</html>